﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmCRUDMaterial.aspx.cs" Inherits="SISLOG.Web.frmCRUDMaterial" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 26px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset><legend>Gestionar Materiales</legend>
        <fieldset><legend>Buscar </legend>
            <asp:Label ID="Label1" runat="server" Text="Ingrese Criterio para Realizar la Busqueda: "></asp:Label>
            <asp:TextBox ID="txtCriterio" runat="server"></asp:TextBox>
            <asp:Button ID="btnBuscar" runat="server" Text="Buscar" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="btnNuevoMaterial"
                runat="server" Text="Nuevo Material" />
            <ajaxToolkit:ModalPopupExtender ID="btnNuevoMaterial_ModalPopupExtender" 
                runat="server" DynamicServicePath="" Enabled="True" 
                PopupControlID="panelNuevoMaterial" TargetControlID="btnNuevoMaterial" 
                OkControlID="btnGuardar">
            </ajaxToolkit:ModalPopupExtender>
            <br />
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataSourceID="ObjectDataSourceMaterial" CellPadding="4" 
                ForeColor="#333333" GridLines="None" DataKeyNames="idMaterial" 
                onrowcommand="GridView1_RowCommand">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField DataField="idMaterial" HeaderText="idMaterial" 
                        SortExpression="idMaterial" />
                    <asp:BoundField DataField="descripcion" HeaderText="descripcion" 
                        SortExpression="descripcion" />
                    <asp:BoundField DataField="idProveedor" HeaderText="idProveedor" 
                        SortExpression="idProveedor" />
                    <asp:BoundField DataField="fechaIngreso" HeaderText="fechaIngreso" 
                        SortExpression="fechaIngreso" />
                    <asp:BoundField DataField="stockInicial" HeaderText="stockInicial" 
                        SortExpression="stockInicial" />
                    <asp:BoundField DataField="stockFinal" HeaderText="stockFinal" 
                        SortExpression="stockFinal" />
                    <asp:BoundField DataField="puntoReorden" HeaderText="puntoReorden" 
                        SortExpression="puntoReorden" />
                    <asp:ButtonField CommandName="Editar" Text="Editar" />
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
            <asp:ObjectDataSource ID="ObjectDataSourceMaterial" runat="server" 
                SelectMethod="GetAllFromMaterialByCriterio" 
                TypeName="SISLOG.BusinessLogic.MaterialBL" 
                onobjectcreating="ObjectDataSourceMaterial_ObjectCreating">
                <SelectParameters>
                    <asp:ControlParameter ControlID="txtCriterio" Name="criterio" PropertyName="Text" 
                        Type="String" DefaultValue="%" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </fieldset>       
    </fieldset>
    <asp:Panel ID="panelNuevoMaterial" runat="server">
        <fieldset> <legend>Material</legend>
            <asp:UpdatePanel ID="upanelMaterial" runat="server">
                <ContentTemplate>
                   
                    <table class="style1">
                        <tr>
                            <td class="style2">
                                <asp:Label ID="lblId" runat="server" Text="IdMaterial"></asp:Label>
                            </td>
                            <td class="style2">
                                <asp:TextBox ID="txtIdMaterial" runat="server" Text="0"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                                Descripcion: </td>
                            <td class="style2">
                                <asp:TextBox ID="txtDescripcion" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Proveedor: </td>
                            <td>
                                <asp:DropDownList ID="ddlProveedor" runat="server" 
                                    DataSourceID="ObjectDataSourceProveedores" DataTextField="nombreEmpresa" 
                                    DataValueField="idProveedor">
                                </asp:DropDownList>
                                <asp:ObjectDataSource ID="ObjectDataSourceProveedores" runat="server" 
                                    onobjectcreating="ObjectDataSourceProveedores_ObjectCreating" 
                                    SelectMethod="GetAllFromProveedor" TypeName="SISLOG.BusinessLogic.ProveedorBL">
                                </asp:ObjectDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Fecha de Ingreso:</td>
                            <td>
                                <asp:TextBox ID="txtFechaIngreso" runat="server"></asp:TextBox>
                                <ajaxToolkit:CalendarExtender ID="tbFechaIngreso_CalendarExtender" 
                                    runat="server" Enabled="True" TargetControlID="txtFechaIngreso">
                                </ajaxToolkit:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Stock Inicial:</td>
                            <td>
                                <asp:TextBox ID="txtStockIni" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Stock Final:</td>
                            <td>
                                <asp:TextBox ID="txtStockFin" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Punto de Reorden:</td>
                            <td>
                                <asp:TextBox ID="txtPuntoReord" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                <asp:Button ID="btnGuardar" runat="server" Text="Guardar" 
                                    onclick="btnGuardar_Click" />
                                <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                   
                </ContentTemplate>
            </asp:UpdatePanel>
        </fieldset>
    </asp:Panel>


     
</asp:Content>
